@extends('layout.default')

@section('layout.content')

  <div class="row">
    <div class="col-xs-12 align-right">
      <div style="margin-bottom: 15px;">
        <a href="{{route('exam.create')}}" class="btn btn-lg btn-danger"><i class="ace-icon fa fa-bookmark"></i>创建答题活动</a>
      </div>
    </div>
  </div><!-- /.row -->

  <div class="row">
    <div class="col-xs-12">
      <table class="table table-hover table-striped table-bordered nonborder">
        <thead>
        <tr>
          <th class="center">序号</th>
          <th class="align-middle">活动名称</th>
          <th class="center">类型</th>
          <th class="center">题目数 / 题库池</th>
          <th class="center">出题类型</th>
          <th class="center">答题人数</th>
          <th class="center">状态</th>
          <th class="center">创建日期</th>
          <th class="align-right">操作</th>
        </tr>
        </thead>
        <tbody>
          @foreach ($warehouses as $i=>$warehouse)
          <tr class="bank">
            <td class="center">
              <span class="smaller-80">{{$i+1}}</span>
            </td>
            <td class="align-middle"><a href="{{route('exam.item', $warehouse->id)}}">{{ $warehouse->name }}</a></td>
            <td class="center">{!! $warehouse->present()->nameType !!}</td>
            <td class="center">{{ $warehouse->number }} / {{ $warehouse->items_count }}</td>
            <td class="center">{!! $warehouse->present()->nameSequence !!}</td>
            <td class="center">{{ $warehouse->users_count }}</td>
            <td class="center">{!! $warehouse->present()->nameStatus !!}</td>
            <td class="center"><span class="grey smaller-80">{{ date('Y-m-d',strtotime($warehouse->created_at)) }}</span></td>
            <td class="align-right">
              <a
              href="{{route('exam.edit',array('id'=>$warehouse->id))}}"
              class="btn btn-xs btn-light">
              <i class="ace-icon fa fa-edit"></i>
            </td>
          </tr>
          @endforeach
        </tbody>
      </table>
    </div>

  </div>

  <div class="row">
    <div class="col-xs-12">
      <div class="dataTables_paginate paging_bootstrap">{{ $warehouses->links() }}</div>
    </div>
  </div>
@stop
@section('javascript')
  <script type="text/javascript">
      $(function () {


      });
  </script>
@stop
